package com.yd.cfckc.util;

import org.apache.log4j.Logger;
import redis.clients.jedis.Jedis;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @author cuiyufeng
 * @email cuiyufeng1458@yundasys.com
 * @date 2020/10/16 3:16 下午
 */
public class SrvUtil {

    private static Logger logger = Logger.getLogger(SrvUtil.class);

    private static Properties properties;
    /**
     * @author
     */

    static{
        //get config file
        properties = new Properties();
        InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("application.properties");
        try {
            properties.load(in);
        	/*Httpsqs4j.setConnectionInfo(properties.getProperty("httpsqs_host"),
					Integer.parseInt(properties.getProperty("httpsqs_port")),
					"UTF-8",
					properties.getProperty("httpsqs_auth"));*/
        } catch (IOException e) {
            //e.printStackTrace();
            logger.error(e.getMessage());
        }
        catch (NumberFormatException e) {
            logger.error(e.getMessage());
        }

    }

    public static Properties getProperties(){
        return properties;
    }

    public static void main(String[] args) {
        SrvUtil.getProperties().getProperty("redishost");
    }
}
